{% extends '::base.html.twig' %}

{% block body -%}
<h1>Listado Personas</h1>

<div id="dt2">
    <table class="datatable" id="table">
        <thead>
            <tr>
                <th>Num</th>
                <th>Apellido</th>
                <th>Nombre</th>
                <th>Tipo Doc</th>
                <th>Nro Doc</th>
                <th>Email</th>
                <th>Telefono</th>
                <th>Sexo</th>
                <th>Tipo Persona</th>
                <th></th>
            </tr>
        </thead>
        <tbody>
        {% set count=0 %}    
        {% for entity in entities %}
                {% set count = count + 1 %}
                <tr>
                    <td>{{ count }}</td>
                    <td>{{ entity.apellido }}</td>
                    <td>{{ entity.nombre }}</td>
                    <td>{{ entity.tipoDoc }}</td>
                    <td>{{ entity.nroDoc }}</td>
                    <td>{{ entity.email }}</td>
                    <td>{{ entity.telefono }}</td>
                    <td>{{ entity.sexo }}</td>
                    <td>{{ entity.tipoPersona }}</td>
                    <td>
                        <ul>
                            <li>
                                <a href="{{ path('personas_edit', { 'id': entity.id }) }}">
                                    <button class="light small icon_only div_icon">
                                        <img src="{{ asset('bundles/admin/images/icons/small/grey/pencil.png') }}">
                                    </button>
                                </a>
                            </li>
                        </ul>
                    </td>
                </tr>
        {% endfor %}
            </tbody>
        </table>
    </div>
    <br/>
    <ul>
        <li>
            <a href="{{ path('personas_new') }}" id="button-nuevo">
                <button class="dark green">
                    <div class="ui-icon ui-icon-plus"></div>
                    <span>Crear Nuevo</span>
                </button>
            </a>
        </li>
    </ul>
    <br/>

    {% block javascripts %}
    <script type="text/javascript">
        $(document).ready(function() {
            $('#table').dataTable();
            
        });
        </script>
    {% endblock %}
    {% endblock %}
